Optimal. Leaf size=93 \[ -\frac {\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac {\sec ^2(c+d x) \left (\left (a^2+3 b^2\right ) \sin (c+d x)+4 a b\right )}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {2837, 12, 1645, 778, 206} \[ -\frac {\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac {\sec ^2(c+d x) \left (\left (a^2+3 b^2\right ) \sin (c+d x)+4 a b\right )}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^2}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 206
Rule 778
Rule 1645
Rule 2837
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan ^2(c+d x) \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {x^2 (a+x)^2}{b^2 \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b^3 \operatorname {Subst}\left (\int \frac {x^2 (a+x)^2}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}+\frac {b \operatorname {Subst}\left (\int \frac {(a+x) \left (-a b^2-3 b^2 x\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac {\sec ^2(c+d x) \left (4 a b+\left (a^2+3 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}-\frac {\left (b \left (a^2-3 b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 d}\\ &=-\frac {\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac {\sec ^2(c+d x) \left (4 a b+\left (a^2+3 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^2 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.77, size = 85, normalized size = 0.91 \[ -\frac {\left (a^2-3 b^2\right ) \tanh ^{-1}(\sin (c+d x))+\frac {1}{4} \sec ^4(c+d x) \left (2 \sin (c+d x) \left (\left (a^2+5 b^2\right ) \cos (2 (c+d x))-3 a^2+b^2\right )+16 a b \cos (2 (c+d x))\right )}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.44, size = 124, normalized size = 1.33 \[ -\frac {{\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 16 \, a b \cos \left (d x + c\right )^{2} - 8 \, a b + 2 \, {\left ({\left (a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.26, size = 124, normalized size = 1.33 \[ -\frac {{\left (a^{2} - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (a^{2} - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (a^{2} \sin \left (d x + c\right )^{3} + 5 \, b^{2} \sin \left (d x + c\right )^{3} + 8 \, a b \sin \left (d x + c\right )^{2} + a^{2} \sin \left (d x + c\right ) - 3 \, b^{2} \sin \left (d x + c\right ) - 4 \, a b\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.30, size = 209, normalized size = 2.25 \[ \frac {a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}+\frac {a^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}+\frac {a^{2} \sin \left (d x +c \right )}{8 d}-\frac {a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {a b \left (\sin ^{4}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{4}}+\frac {b^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {b^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}-\frac {b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d}-\frac {3 b^{2} \sin \left (d x +c \right )}{8 d}+\frac {3 b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 120, normalized size = 1.29 \[ -\frac {{\left (a^{2} - 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{2} - 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (8 \, a b \sin \left (d x + c\right )^{2} + {\left (a^{2} + 5 \, b^{2}\right )} \sin \left (d x + c\right )^{3} - 4 \, a b + {\left (a^{2} - 3 \, b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 17.05, size = 191, normalized size = 2.05 \[ \frac {\left (\frac {a^2}{4}-\frac {3\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {7\,a^2}{4}+\frac {11\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {7\,a^2}{4}+\frac {11\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {a^2}{4}-\frac {3\,b^2}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {a^2}{4}-\frac {3\,b^2}{4}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________